package io.zhengsh.order.config.feign;

import feign.Logger;
import feign.RequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FeignSupportConfig {

    @Bean
    public RequestInterceptor getRequestInterceptor() {
        return new FeignRequestInterceptor();
    }

// 一下配置可以替代 @Bean code config
// feign:
//  client:
//    config:
//      default:
//        connectTimeout: 5000
//        readTimeout: 5000
//        loggerLevel: full
    @Bean
    public Logger.Level feignLoggerLevel() {
        return Logger.Level.FULL;
    }
}
